# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Maintainer: Roberto Oliveira <robertoguimaraes8@gmail.com>
pkgname=calcurse
pkgver=4.6.0
pkgrel=0
pkgdesc="A text-based personal organizer"
url="https://calcurse.org/"
license="BSD-2-Clause"
arch="all"
makedepends="ncurses-dev"
checkdepends="tzdata"
subpackages="$pkgname-doc"
source="https://calcurse.org/files/calcurse-$pkgver.tar.gz
	0001-Accept-empty-DESCRIPTION-in-ical-import.patch"

prepare() {
	default_prepare

	# The test is "sloppily written" and currently fails:
	#
	#  Please note that the calcurse [...] works even though the test fails.
	#
	# See: https://github.com/lfos/calcurse/issues/274#issuecomment-611716028
	sed -i test/Makefile.in -e '/ical-009.sh \\/d'
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-nls \
		--enable-docs \
		--without-asciidoc
	make
}

check() {
	make -j1 -C "$builddir" check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="1d52b9412726c844814be5caeb58520b493123c0af34aa7ceeec459d03cb8dd53be1ff4f702ce468fa7aad84b91b361d61fdbea41062e68da8926cf5dcb9d748  calcurse-4.6.0.tar.gz
8ca462dbe91ca4df4aa244c4a9260b1059ff1c8a2f4706df5ce5489747283667807ae5b5995c5e7ef72795abae862374b0d1e6541bfb4cf2dd0dabf6df2bb6f4  0001-Accept-empty-DESCRIPTION-in-ical-import.patch"
